Reproducible Documentation of Analyses

Author

Sonja Hahn, Samuel Merk

Libraries

library(tidyverse)
library(reactable)

Data Download

The raw data of the study blalablalba you can download it here

Itemcodes:

read_csv("data/question_keys_data.csv") |> 
  reactable()
Rows: 46 Columns: 3
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): short_name, statement
dbl (1): id

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Data Import

# raw data experiment 1 ########################################################
## import data from suf
data_s1 <- read_csv("data/eva_data_OEQexperimentI.csv")%>%
  mutate(answer_text_isna = is.na(answer_text),
         answert_text_isna_or_length0 = ifelse(answer_text_isna == T, T,
                                         nchar(answer_text) == 0),
         no_oeq_answer = ifelse(question_id %in% c(47:48),
                                answer_text_isna, NA),
         question_id_fac = as.factor(question_id),
         position = ifelse(survey_id %in% c(2,3), 
                           "at the beginning", "at the end"),
         instruction = ifelse(survey_id %in% c(2,5),
                              "motivating instruction", "neutral instruction"),
         oeq_answerlengthifgiven = ifelse(no_oeq_answer == T, 
                                          NA, 
                                          nchar(answer_text)),
         oeq_answerlengthifgiven_log = log(oeq_answerlengthifgiven))%>%
  group_by(class_id, question_id)%>%
  mutate(oeq_answer_classprop = 1 - mean(no_oeq_answer, na.rm = T),
         oeq_answerlengthifgiven_perclass = sum(nchar(answer_text), na.rm = T)/(n()-sum(no_oeq_answer)))%>%
  ungroup()
Rows: 131161 Columns: 16
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr  (5): answer_text, answer_string, respondent_hash, course_city, unique_i...
dbl  (9): id, question_id, survey_id, completed_survey_id, answer_integer, c...
lgl  (1): answer_float
date (1): start_date

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.